<script src="../media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="../media/system/js/core.js" type="text/javascript"></script>
<form action="index.php?top=page&option=com_frcenter" method="post" name="adminFormSearch" id="adminFormSearch">
<!-- LEFT -->
 <?php echo $this->loadTemplate('search','default') ?>
<input type="hidden" name="task" value="search" />
 <!-- END LEFT -->
</form>
<form action="index.php?top=page&option=com_frcenter&task=coach" method="post" name="adminForm" id="adminForm">
 <!-- CONTENT -->
 <div id="jm-content">
    <div class="cc title">
        <div class="id"><?php echo $this->info_ocba->OCBA_CODE; ?></div>
        <div class="cc-title">
            <p class="top"><?php echo $this->info_ocba->OCBA_KANA; ?></p>
            <p class="bot"><?php echo $this->info_ocba->OCBA_NAME; ?><span class="float-right">【<?php echo $this->info_ocba->OCBA_SHOR; ?>】</span></p>
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="menu-cc">
        <ul id="nav">
        
        <?php 
            foreach(bgData::getMenuDetailCenter() as $key=>$item){
                $acctive = 'normal';
                if(JRequest::getVar('task') == $key){
                    $acctive = 'current';
                }
         ?>
            <li class="<?php echo $acctive; ?>"><a href="index.php?top=page&option=com_frcenter&task=<?php echo $key; ?>&id=<?php echo $this->info_ocba->OCBA_CODE; ?>"><?php echo $item; ?></a></li>
          <?php } ?>
            
        </ul>
    </div>
    
    <div id="">     
     <h3 class="h_title">指導者</h3>     
        <div class="info-basic">                                    
            <div >
            <?php 
                if($this->rows != null){ 
            ?>
                <table width="100%" cellpadding="0" cellspacing="0" id="tb_blue" border=1>
                    <tbody>
                        <th>コード</th>
                        <th>氏名</th>
                        <th>所属</th>
                        <th>常勤</th>
                        <th>指導員資格</th>
                        <th>有効期限</th>
                        <th></th>
                        
                        <?php
                        
                            foreach($this->rows as $row){
                        ?>
                        <tr>
                            <td style="width: 6%; padding-left: 5px;"><?php echo $row->COCH_CODE; ?></td>
                            <td style="width: 15%; padding-left: 5px;"><?php echo $row->COCH_NAME; ?></td>
                            <td style="width: 20%; padding-left: 5px;"><?php echo $row->OCBA_NAME; ?></td>
                            <td style="width: 5%;text-align: center;"><?php if($row->COCH_WOKF == 1){ echo "●"; } ?></td>
                            <td style="width: 20%; padding-left: 5px;">
                                <?php 
                                    $model = $this->getModel();
                                    $this->colis = $model->loadcoli($row->COCH_CODE);
                                    if($this->colis != null){
                                        $i=0;
                                        foreach($this->colis as $k=>$coli){ 
                                            $i++;
                                            if($i == 1){
                                               echo $coli->COCM_NAME;
                                            }
                                            else{
                                                echo "<br />" . $coli->COCM_NAME;
                                            }
                                           echo '(';
                                           echo $coli->COLI_TERM; 
                                           if($coli->COLI_UNIT == 1) echo '回';
                                                   else if  ($coli->COLI_UNIT == 2) echo '期';
                                                   else if  ($coli->COLI_UNIT == 3) echo '年度';
                                           echo ')';
                                        }
                                    }
                                ?> 
                            </td>
                            <td style="width: 13%;"><?php if($row->COCH_LDATE!='0000-00-00 00:00:00') echo HelperBG::F_GetDate_JP($row->COCH_LDATE); ?></td>
                            <td style="width: 10%;" align="center" ><button name="btndetail" class="button" href="index.php?top=page&option=com_frleader&task=detail&cid=<?php echo $row->COCH_CODE; ?>">詳細</button></td>
                        </tr>
                        <?php
                            }
                        
                        ?>
                        
                    </tbody>
                    
                </table>
                <table style="width: 100%;">
                    <tfoot>
            			<tr>
            				<td colspan="15" style="text-align: center;">
            				    <?php echo $this->paginationCoch->getListFooter(); ?>
                            </td>
            			</tr>
            		</tfoot>
                </table>
         <?php
         }else{
            echo '<p align="center" >データは見つかりませんでした</p>';
         }
         ?>           
         </div>
        </div> 
        
        <input type="hidden" name="task" value="coach" /> 
        <input type="hidden" name="id" value="<?php echo $this->info_ocba->OCBA_CODE; ?>" />      
</div>
    
 </div>
 <!-- END CONTENT -->
 </form>
 <script>
 Joomla.submitbutton = function(task){
    if(task == 'search'){
        Joomla.submitform(task, document.getElementById('adminFormSearch'));
        return false;
    }
 }
 </script>
 

                           

